<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/base/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>${systemOption.systemTitle}</title>
    <%@ include file="/base/head.jsp"%>
<script language="javascript" type="text/javascript" src="${ctx}/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="${ctx}/css/salary/main.css" type="text/css"></link> 

<style type="text/css">
	body{
		text-align:center;
	}
	.buttonBack{
		width:67px;
		height:22px;
		border:0px;
		cursor: pointer;
	}
	input{
		border:1px solid gray;
		height:22px;
	}
	a:hover{
		text-decoration: underline;
	}
</style>
</head>
<body style="overflow-y:scroll">
	
   
<div class="table_top" style="height:100%" >
	<div>
		 <table width="100%" class="top" cellpadding="0" cellspacing="0">
			<tr>
				<td class="td_top"><b>当前位置:</b>&nbsp;<a href="aaaa" target="main">考勤管理</a>>>考勤设置

</td>
			</tr>
		 </table>
	</div>
	<div height="100%" style="margin-top:10px;">
		<br><form action=""  method="post" id="editForm">
		<fieldset style="width:98%">
			<legend>考勤设置：</legend>
			<table border="0" cellpadding="0" cellspacing="15">
           <tr>
                <td>迟到罚款：<input id="sid" type="text" size="1" name="id" style="display: none"/></td>
                <td ><input id = "slateCome" type="text" size="1"   name="clatecome"/>元/次</td>
                  
            </tr>
            <tr>
                <td>早退罚款：</td>
                <td ><input id="searlyLeave" type="text" size="1"  name="cearlyleave"/>元/次</td>
                  
            </tr>
            
            <tr>
                <td>请假罚款：</td>
                <td ><input id="sleave" type="text" size="1"   name="cleave"/>元/天</td>
                  
            </tr>
            <tr>
                <td>旷工罚款：</td>
                <td ><input id="snegletwork" type="text" size="1"   name="cnegletwork"/>元/时</td>
                  
            </tr>
             <tr>
                <td>加班奖金：</td>
                <td ><input id="sovertime" type="text" size="1"  name="covertime"/>元/时</td>
                  
            </tr>
            
            <tr>
                <td colspan="4">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">&nbsp;</td>
                <td align="left">
                 <button href="javascript:void(0)" onclick="update()" class="easyui-linkbutton buttonBack" data-options="iconCls:'icon-edit',plain:true">修改</button>
               	 <span id="message" style="display: none;color: blue"></span>
   					<span id="msg" style="color:red">${message}</span>
                 	&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
        </table>
     </fieldset>
     </form>
    </div>
  </div>
</body>
	<script type="text/javascript">
	$(function(){//页面加载完成时
			initPage();
		});
	
		function initPage(){
			$.ajax({url:"${ctx}/attendence/loadSet.action", async:false,success:function(data) {
				console.log(data);
				$('#sid').val(data.id);
				$('#slateCome').val(data.clatecome);
				$('#searlyLeave').val(data.cearlyleave);
				$('#sleave').val(data.cleave);
				$('#snegletwork').val(data.cnegletwork);
				$('#sovertime').val(data.covertime);
				
			}
			});	
		}
		
		function update(){
		
		$.ajax({url:"${ctx}/attendence/updateSet.action", 
			data:{id:$('#sid').val(),clatecome:$('#slateCome').val(),
			cearlyleave:$('#searlyLeave').val(),cleave:$('#sleave').val(),
			cnegletwork:$('#snegletwork').val(),covertime:$('#sovertime').val()},
			async:false,success:function(data) {
				 $('#message').show();
				 $('#message').html('修改成功');
			}
			});	
		}
	
	
	
	
	
	
	</script>

</html>